package cn.iocoder.devlop.module.annual.report.baseinfo.dal;


import cn.iocoder.devlop.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.devlop.framework.mybatis.core.query.MPJLambdaWrapperX;
import cn.iocoder.devlop.module.annual.report.baseinfo.controller.vo.CompletionCheckVO;
import cn.iocoder.devlop.module.annual.report.baseinfo.dal.dataobject.BaseinfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 年报基本信息表(基本信息，资产状况，党建信息) Mapper
 *
 * @author sunhao
 */
@Mapper
public interface BaseinfoMapper extends BaseMapperX<BaseinfoDO> {


    List<CompletionCheckVO> selectListByInfo(@Param("regno") String regno, @Param("uniscid") String uniscid, @Param("tables") List<String> tables);

    default BaseinfoDO selectByRegnoAndAncheyear(String regno, String ancheyear) {
        MPJLambdaWrapperX<BaseinfoDO> wrapper = new MPJLambdaWrapperX<>();
        wrapper.selectAll(BaseinfoDO.class)
                .disableLogicDel()
                .disableSubLogicDel()
                .eq(BaseinfoDO::getRegno, regno)
                .eq(BaseinfoDO::getAncheyear, ancheyear);
        return selectJoinOne(BaseinfoDO.class, wrapper);
    }

}
